#ifndef _RETURNSTATEMENT_
#define _RETURNSTATEMENT_

#include "Statement.h"
#include "Expression.h"

class ReturnStatement: public Statement
{
public:
    ReturnStatement(TreeNode* iReturnExpression);
    virtual ~ReturnStatement();
    virtual void CheckVariables(set<string>& oVariables, string iParentName);
    virtual void CheckFunctionCalls(set<FunctionDefinition*>& iAllFunctions, string iParentName);
    virtual void CheckClassConstructions(set<ClassDefinition*>& iAllClasses, string iParentName);
    virtual void CheckExpressionTypes(map<string, ExpressionType*>& iVarTypes, string iParentName);
    virtual ReturnStatement* GetFirstReturnStatement() { return this; }
    virtual void Accept(GeneralVisitor* iVisitor);

    ExpressionType* GetReturnType(map<string, ExpressionType*>& iVarTypes, string iParentName);

    TreeNode* GetReturnExpression() { return fReturnExpression; }
    void SetReturnExpression(TreeNode* iNewExpr);

private:
    TreeNode* fReturnExpression;
};

#endif
